package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TAccessRecordsMapper;
import com.ruoyi.system.domain.TAccessRecords;
import com.ruoyi.system.service.ITAccessRecordsService;

/**
 * 访问记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-05-30
 */
@Service
public class TAccessRecordsServiceImpl implements ITAccessRecordsService 
{
    @Autowired
    private TAccessRecordsMapper tAccessRecordsMapper;

    /**
     * 查询访问记录
     * 
     * @param id 访问记录主键
     * @return 访问记录
     */
    @Override
    public TAccessRecords selectTAccessRecordsById(Long id)
    {
        return tAccessRecordsMapper.selectTAccessRecordsById(id);
    }

    /**
     * 查询访问记录列表
     * 
     * @param tAccessRecords 访问记录
     * @return 访问记录
     */
    @Override
    public List<TAccessRecords> selectTAccessRecordsList(TAccessRecords tAccessRecords)
    {
        return tAccessRecordsMapper.selectTAccessRecordsList(tAccessRecords);
    }

    /**
     * 新增访问记录
     * 
     * @param tAccessRecords 访问记录
     * @return 结果
     */
    @Override
    public int insertTAccessRecords(TAccessRecords tAccessRecords)
    {
        tAccessRecords.setCreateTime(DateUtils.getNowDate());
        return tAccessRecordsMapper.insertTAccessRecords(tAccessRecords);
    }

    /**
     * 修改访问记录
     * 
     * @param tAccessRecords 访问记录
     * @return 结果
     */
    @Override
    public int updateTAccessRecords(TAccessRecords tAccessRecords)
    {
        return tAccessRecordsMapper.updateTAccessRecords(tAccessRecords);
    }

    /**
     * 批量删除访问记录
     * 
     * @param ids 需要删除的访问记录主键
     * @return 结果
     */
    @Override
    public int deleteTAccessRecordsByIds(Long[] ids)
    {
        return tAccessRecordsMapper.deleteTAccessRecordsByIds(ids);
    }

    /**
     * 删除访问记录信息
     * 
     * @param id 访问记录主键
     * @return 结果
     */
    @Override
    public int deleteTAccessRecordsById(Long id)
    {
        return tAccessRecordsMapper.deleteTAccessRecordsById(id);
    }
}
